CGSGTimeline Class
Item Index
Methods
Methods
_computeStepsValues
()
private
Compute the number of steps between all keys, 2 by 2
addKey
(
public
-
frame. -
value
Add a new animation key frame to the timeline and sort the timeline by frame number
computeValue
(
private
-
keyIndex -
frame -
method
Compute animated value for one frame between key ay index keyIndex and keyIndex+1
Parameters:
Returns:
:
Object with 2 properties : frame and value, or undefined if keyIndex < 0
computeValues
(
public
-
fromFrame -
method
Compute all the values (steps) for the animation of this timeline
getNbKeys
()
Number
public
Returns:
Number:
the number of keys in this timeline. Must be an integer value.
getValue
(
Number
public
-
frame
Get the value for the frame number passed in parameter
Parameters:
-
frameNumberthe frame bound with the returned value. Must be an integer value.
Returns:
Number:
the interpolated value of the attribute at the specified frame
If no key is defined, return undefined
If there is only one key, return it's value
If the frame is before the first key, return the first key value
If the frame is after the last key, return the last key value
importValues
(
-
newValues -
startFrame
Import new precomputed values for this timeline. The number of values must match the number of frame defined by the keys of this timeline
removeAll
()
public
Remove all keys and values
removeKey
(
-
frame
Remove the key at the specified frame
Parameters:
-
frameNumberMust be an integer value.
sortByFrame
()
public
Sort the list of keys by frame number